﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Arch.Intercep;

namespace Arch.Aspects
{
    [AttributeUsage(AttributeTargets.Class)]
    public class Order : Attribute, IRepositoryPropertyInterceptor
    {
        public string DefaultOrder { get; set; }
        public bool IsPostOrder { get; set; }

        public Order()
        {

        }
        
        public Order(string order)
            : this()
        {
            DefaultOrder = order;
        }

        public Order(string order, bool isPostOrder)
            : this(order)
        {
            IsPostOrder = isPostOrder;
        }

        private static readonly string[] FixedProperties = new string[] { "DefaultOrder", "IsPostOrder" };
        public IEnumerable<string> Properties { get { return FixedProperties; } }

        public ActionTarget Targets { get { return ActionTarget.InfrastructureLoaded; } }
    }
}
